package com.sdx.console.qaVideo.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.qaVideo.dao.QaVideoDao;
import com.sdx.console.qaVideo.entity.QaVideo;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 视频 Service
 */

@Service
@Transactional
public class QaVideoService extends BaseService<QaVideo>{

    @Resource
	private QaVideoDao qaVideoDao;

    public PageQuery<QaVideo>queryByCondition(PageQuery query){
        PageQuery ret =  qaVideoDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public PageQuery<QaVideo>queryColVideoByCondition(PageQuery query){
        PageQuery ret =  qaVideoDao.queryColVideoByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public PageQuery<QaVideo>queryVideoByCondition(PageQuery query){
        PageQuery ret =  qaVideoDao.queryVideoByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelQaVideo(List<String> ids){
        try {
            qaVideoDao.batchDelQaVideoByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除视频失败", e);
        }
    }

	public List<QaVideo> all() {
		return qaVideoDao.all();
		}
}
